package com.gaojinqi.base.core.jpa.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.Transient;
import java.io.Serializable;
import java.util.*;

/**
 * 注解查询抽象实体类
 *
 * @author gaojinqi
 * @version 1.0
 * @since 2020年06月23日
 */
public abstract class AnnotationQueryEntity implements Serializable {

    /**
     * 用于指定当前实体的分组
     */
    @JsonIgnore
    @Transient
    private transient Set<Class<?>> groups = new LinkedHashSet<>();

    public void setGroups(Class<?>... groups) {
        Set<Class<?>> groupSet = new LinkedHashSet<>();
        Collections.addAll(groupSet, groups);
        this.groups = groupSet;
    }

    public Set<Class<?>> getGroups() {
        return groups;
    }

}
